using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace ReportTemplates
{
    public partial class FrmPrintReport : DevExpress.XtraEditors.XtraForm
    {
        public FrmPrintReport(CrystalDecisions.CrystalReports.Engine.ReportClass report, string titleBar)
        {
            InitializeComponent();
            this.crystalReportViewer.ReportSource = report;
            this.Text = titleBar;
        }

        public FrmPrintReport( CrystalDecisions.CrystalReports.Engine.ReportDocument report, string titleBar)
        {
            InitializeComponent();
            this.crystalReportViewer.ReportSource = report;
            crystalReportViewer.Refresh();
            this.Text = titleBar;
        }

        protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            switch (keyData)
            {
                case Keys.Escape:
                    this.Close();
                    break;
                case Keys.Control | Keys.Q:
                    this.Close();
                    return true;
                    break;
            }
            return base.ProcessCmdKey(ref msg, keyData);
        }
    }
}